trigger ContactEmailUpdate on Contact (after update) {
	Map<Id, Contact> newContacts = new Map<Id, Contact>(trigger.new);
	Map<Id, Contact> oldContacts = new Map<Id, Contact>(trigger.old);
	Map<Id, Contact> changedContacts = new Map<Id, Contact>();
	
	for (Id key : newContacts.keySet()) {
		Contact newContact = newContacts.get(key);
		Contact oldContact = oldContacts.get(key);
		if (newContact.email != oldContact.email) {
			changedContacts.put(newContact.Id, newContact);
		}
	}
	if (changedContacts.size() > 0) {
		List<MeetingInvitees__c> inv = [Select Id, Email__c, Contact__c From MeetingInvitees__c Where Contact__c in :changedContacts.keySet()];
		for (MeetingInvitees__c mi : inv) {
			mi.Email__c = changedContacts.get(mi.Contact__c).Email;
		}
		
		List<MeetingAttendees__c> att = [Select Id, Email__c, Contact__c From MeetingAttendees__c Where Contact__c in :changedContacts.keySet()];
		for (MeetingAttendees__c ma : att) {
			ma.Email__c = changedContacts.get(ma.Contact__c).Email;
		}
		
		update inv;
		update att;
	}
}